import {ref} from 'vue'
import { defineStore } from 'pinia'
export const useUserStore = defineStore('userStore', () => {
  const userInfo = ref(null)
  const userSetting = ref(null)
  const setUserInfo = (fields) => {
    userInfo.value = fields
  }

  const setUserSetting = (setting_obj) => {
    userSetting.value = setting_obj
  }

  return {userInfo, setUserInfo, userSetting, setUserSetting }
}, {
  persist: {
    storage: sessionStorage
  }
})
